#include<stdio.h>

int main(void)
{
    int ints[100];
    int n;
    scanf("%d",&n); 
    for (int i = 0; i < n; i++)
    {
        int m;
        scanf("%d",&m);

        ints[1] = 1;
        ints[2] = 3;

        for (int j = 3; j < m+1; j++)
        {
            ints[j] = 2*ints[j-2] + ints[j-1];
        }
        printf("%d\n",ints[m]);
    }
    
}